<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>Main</title>
    <f:metadata>
        <f:event listener="#{loginBean.verifyUseLogin}" type="preRenderView">
        </f:event>
    </f:metadata>
</h:head>
<h:body>
    <ui:composition template="menutemp.xhtml">
        <h:form>
            <p:growl id="growl" showDetail="true" autoUpdate="true" life="10000" />
            <p:commandButton value="Ändere Password" id="change" onclick="dlg.show();" />
            <p:dialog id="changePw" header="Ändere Password" widgetVar="dlg" modal="true">
                <h:panelGrid columns="2" id="matchGrid">
                    <h:outputLabel for="pwd1" value="Password 1: *" />
                    <p:password id="pwd1" value="#{menuBean.password}" label="Password 1" required="true" />

                    <h:outputLabel for="pwd2" value="Password 2: *" />
                    <p:password id="pwd2" value="#{menuBean.password2}" label="Password 2" required="true" />
                </h:panelGrid>
                <p:commandButton id="saveButton" value="Save" actionListener="#{menuBean.changePw}"
                    oncomplete="dlg.hide();" update="growl" />
            </p:dialog>
        </h:form>
    </ui:composition>
</h:body>
</html>